package com.sinopec.basemodule.constants;

import com.sinopec.basemodule.BaseApplication
import com.sinopec.basemodule.utils.preferences.preferencesExt


/**
 * 类描述：类描述：PreferencesConstant <br/>
 * 创建人：lwj<br/>
 * 创建时间：2019/8/13 19:52 <br/>
 */
class PreferencesConstant private constructor() {
    companion object {
        private var INSTANCE: PreferencesConstant? = null

        @Synchronized
        @JvmStatic
        fun getInstance(): PreferencesConstant {
            return when (INSTANCE) {
                null -> {
                    INSTANCE = PreferencesConstant()
                    INSTANCE!!
                }
                else -> INSTANCE!!
            }
        }
    }

    /**
     * session
     */
    var _session by preferencesExt(-1)

    /**
     * 标志
     */
    var _flag by preferencesExt(-1)

    /**
     * 蜂鸣器模式
     * 0：关
     * 1：BEEPER
     * 2：BEEPER_SHORT
     */
    var beeper_model by preferencesExt(2)

    /**
     * RFID校验规则
     * power update by lwj
     */
    var rfid_regex by preferencesExt(
        "^((1[1-2]11)[A-Z0-9]{8}$|(86)[A-Z0-9]{10}$|(87)[A-Z0-9]{10}$|(F6)[A-Z0-9]{10}$|(BC)[A-Z0-9]{10}$)"
    )
}